<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        function FiBo(n) {
            if (n < 0) {
                return "请输入正整数"
            } else if (n == 0) {
                return 0
            } else if (n == 1) {
                return 1
            } else {
                return FiBo(n - 1) + FiBo(n - 2)
            }
        }
        console.log(FiBo(6));
     </script>

</body>

</html>